<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use module\manage\middleware\Auth;

Route::domain('manage', function(){
    Route::get('', 'Index/index'); // 首页
    Route::get('home', 'Index/home'); // 首页
    Route::post('login', 'Visitor@login')->middleware('throttle', [
        'visit_rate' => '10/m',
    ]);
    Route::get('menu/list', 'Menu/list');
    Route::get('menu/tree', 'Menu/tree');

    Route::group(function(){
        Route::post('me/reset', 'Me/reset'); // 重置密码
        Route::get('logout', 'Me/logout'); // 重置密码
        Route::resource('me', 'Me')->only(['index', 'update', 'delete']);
        Route::resource('help', 'Help')->except(['create', 'edit']);
        Route::resource('adv', 'Adv')->except(['create', 'edit']);
        Route::resource('admin', 'auth\Admin')->except(['create', 'edit']);
        Route::resource('role', 'auth\Role')->except(['create', 'edit']);
        Route::get('perm/tree', 'auth\Perm@tree');
        Route::resource('perm', 'auth\Perm')->except(['create', 'edit']);
        Route::get('menu/tree', 'Menu@tree');
        Route::resource('menu', 'Menu')->except(['create', 'edit']);
        Route::resource('user', 'User')->only(['index']);
        Route::resource('order', 'Order')->only(['index', 'read']); // 考试报名
        Route::resource('activity', 'Activity')->except(['create', 'edit']);
        Route::resource('activity-album', 'ActivityAlbum')->except(['create', 'edit']);
        Route::resource('activity-enroll', 'ActivityEnroll')->except(['create', 'edit']);
        Route::resource('activity-worker', 'ActivityWorker')->except(['create', 'edit']);
        Route::resource('dynamic', 'Dynamic')->except(['create', 'edit']);
        Route::resource('dynamic-comment', 'DynamicComment')->except(['create', 'edit']);
        Route::resource('user-upvote', 'Upvote')->only(['index', 'update', 'delete']); // 点赞
        Route::resource('user-focus', 'Focus')->only(['index', 'update', 'delete']); // 关注
        Route::resource('user-invite', 'Invite')->only(['index', 'read']); // 邀请
        Route::resource('user-fans', 'Fans')->only(['index']); // 粉丝
        Route::resource('user-voucher', 'UserVoucher')->only(['index', 'read']); // 代金券
        Route::resource('user-deposit', 'UserDeposit')->only(['index', 'read']); // 提现
        Route::resource('user-point', 'UserPoint')->only(['index', 'read']); // 积分
    })->middleware([Auth::class]);
})->prefix('\module\manage\controller\\')->middleware('format')->allowCrossDomain();
